package br.mikhas.container.config;

/**
 * <p>
 * This dependecy is a straight passed value on the resource definition.
 * 
 * <p>
 * This value will be parsed during the bean instantiation
 * 
 * @author Mikhail Domanoski
 * 
 */
public class ValueDependecy extends UnresolvedDependency {

	/**
	 * The plain text value
	 */
	private String value;

	/**
	 * Creates a new instance of {@link ValueDependecy}
	 * 
	 * @param type
	 *            The java type of this dependency
	 * @param destiny
	 *            The {@link DependencyTarget} of this dependency
	 */
	public ValueDependecy(Class<?> type, DependencyTarget destiny) {
		super(type, destiny);
	}

	/**
	 * Returns a plain string value which will be converted to fulfilss the
	 * dependency
	 */
	public String getStringValue() {
		return this.value;
	}

	/**
	 * Sets a plain string value to be converted and fills the dependency.
	 * 
	 * @param value
	 *            A plain string value
	 */
	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public String toString() {
		return "ValueDependecy [value=" + value + ", type=" + type
				+ ", required=" + required + "]";
	}

}
